<seed-content class="seed-crowd-details-page"
              *ngIf="crowdDetail">
  <seed-toolbar-header>
    <seed-toolbar-title>众筹：{{crowdDetail.crowdName}}</seed-toolbar-title> <!--名字不是固定的-->
    <seed-toolbar-menu></seed-toolbar-menu>
  </seed-toolbar-header>

  <seed-infinite-scroll
    (infiniteScroll)="handleScrollLoading()">
    <div class="seed-crowd-details">
      <div class="crowd-auth-header">
        <div class="user-info" (click)="goToHomepage(crowdDetail.userBaseResp?.userId)">
          <seed-avatar
            [lazyLoadAvatar]="crowdDetail.userBaseResp?.iconUrl"
            [userId]="crowdDetail.userBaseResp?.userId"
          ></seed-avatar>
          <div class="info-text">
            <span>{{crowdDetail.userBaseResp?.nickName|truncate:10}}</span>
            <time>{{crowdDetail.createTime| amDateFormat:'YYYY/MM/DD HH:mm'}} 发布</time>
          </div>
        </div>
        <div class="crowd-target-money">
         <img [src]="url"
              *ngIf="crowdStauts"
              class="status-picture">
          <div class="target-money-info">
            <div>
              <p>目标金额</p>
              <span>{{(crowdDetail.crowdMoney/100).toFixed(2)||0}}</span>
            </div>
            <div>
              <p>已筹金额</p>
              <span>{{(crowdDetail.saleMoney/100).toFixed(2)||0}}</span>
            </div>
            <div>
              <p>剩余时间 </p>
              <span>{{crowdDetail.crowdStatus==3?(crowdDetail.limitTime | remainingTimePipe):'00:00'}}</span>
            </div>
          </div>
          <seed-crowd-progress
            [salePercent]="crowdDetail.salePercent"
          ></seed-crowd-progress>
        </div>
      </div>
      <div class="crowd-message">
        <seed-tab (tabSelect)="getTabIndex($event)">
          <seed-tab-item [title]="'众筹详情'">
            <crowd-info *ngIf="crowdDetail" [userId]="userId"  [crowdDetail]="crowdDetail"></crowd-info>
          </seed-tab-item>
          <seed-tab-item [title]="'支持者' + '(' + supporterTotal + ')'">
            <crowd-supporter *ngIf="supporterList" [supporterList]="supporterList"></crowd-supporter>
          </seed-tab-item>
          <!--<seed-tab-item [title]="'活动动态'+ '('+ dynamicTotal + ')'">-->
          <seed-tab-item [title]="'活动动态'+ '(' + dynamicTotal + ')' ">
            <crowd-activity *ngIf="dynamicList" [dynamicList]="dynamicList"></crowd-activity>
          </seed-tab-item>
        </seed-tab>
      </div>
    </div>
  </seed-infinite-scroll>
  <missing-default-content *ngIf="crowdDetail.length==0"></missing-default-content>

  <seed-modal #numModal [content]="content">
      <buy-sku class="seed-modal-content"
               (closeSkuSelect)="closeSku()"
               [crowdSku]="crowdSku"
               [crowdCode]="crowdCode"
               [crowdLaunch]="crowdLaunch"
      ></buy-sku>
  </seed-modal>
  <div class="crowd-shadow-modal"
       [ngClass]="{'crowd-shadow-login':hasLogin && (userId == crowdDetail.userBaseResp.userId)}"
       *ngIf="crowdDetail.crowdStatus == 4 || crowdDetail.crowdStatus == 5 || crowdDetail.crowdStatus == 6"
  >{{(crowdDetail.crowdStatus == 4 || crowdDetail.crowdStatus == 5)?'已结束':(crowdDetail.crowdStatus == 6?'已下架':'')}}</div>

  <!--未登录状态-->
  <div class="crowd-button-status seed-scroll-outside"
       *ngIf="!hasLogin || (hasLogin && ((userId != crowdDetail.userBaseResp.userId) && crowdDetail.crowdStatus == 3 && skuShow))"
  >
    <button class="seed-crowd-support" (click)="buySku()">支持ta</button>
  </div>
  <!--众筹状态为4的判断-->
  <div class="crowd-button-status seed-scroll-outside"
       *ngIf="(!hasLogin || (hasLogin && (userId != crowdDetail.userBaseResp.userId))) && (crowdDetail.crowdStatus != 3)" >
    <button class="on-crowd-support">支持ta</button>
  </div>
  <!--根据状态显示-->
  <div class="seed-crowd-button-status seed-infinite-scroll seed-scroll-outside"
  *ngIf="editSkuShow"
  >
    <!--待审核-->
    <button  class="crowd-entitle-table1"
             *ngIf="hasLogin&&(userId==crowdDetail.userBaseResp.userId)&&crowdDetail.crowdStatus == 1"
             (click)="entitleTable()">权益列表
    </button>
    <!--众筹中crowdDetail.salePercent<100% -->
    <div class="crowd-out3 seed-flexbox seed-flexbox-align-center seed-flexbox-content-between"
         *ngIf="hasLogin && (userId==crowdDetail.userBaseResp.userId) && crowdDetail.crowdStatus == 3 && matchPersent(crowdDetail.salePercent) "
          (click)="soldOut()">
      <span  *ngIf="soldOuted" class="crowd-out-icon"></span>
      <span *ngIf="soldOuted" class="crowd-out-desc">下架</span>
      <span  *ngIf="soldOvered" class="crowd-out-desc">已下架</span>
    </div>
    <button   class="crowd-entitle-table-list"
              *ngIf="crowdDetail.crowdStatus == 3 && hasLogin && (userId==crowdDetail.userBaseResp.userId) && matchPersent(crowdDetail.salePercent) "
              (click)="entitleTable()">权益列表</button>
   <!-- 众筹中crowdDetail.salePercent>=100% -->
    <div class="crowd-out-sold seed-flexbox seed-flexbox-align-center seed-flexbox-content-between" (click)="soldOut()"
         *ngIf="crowdDetail.crowdStatus == 3 && hasLogin && !matchPersent(crowdDetail.salePercent) && (userId==crowdDetail.userBaseResp.userId)"
         >
      <span *ngIf="soldOuted"  class="crowd-out-icon"></span>
      <span *ngIf="soldOuted"   class="crowd-out-desc">下架</span>
      <span  *ngIf="soldOvered"  class="crowd-out-desc">已下架</span>
    </div>
    <div class="crowd-out-out seed-flexbox seed-flexbox-align-center seed-flexbox-content-between" (click)="headEnd()"
         *ngIf="crowdDetail.crowdStatus == 3 && hasLogin && !matchPersent(crowdDetail.salePercent) && (userId==crowdDetail.userBaseResp.userId)">
      <span class="crowd-end-icon"></span>
      <span class="crowd-end">提前结束 </span>
    </div>
    <button
      *ngIf="crowdDetail.crowdStatus == 3 && hasLogin && !matchPersent(crowdDetail.salePercent) && (userId==crowdDetail.userBaseResp.userId)"
      class="crowd-entitle-table3" (click)="entitleTable()"
    >权益列表</button>
<!--已下架-->
    <div class="crowd-desc-delet seed-flexbox seed-flexbox-align-center seed-flexbox-content-between"
         *ngIf="crowdDetail.crowdStatus == 6 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
         (click)="deleteInfo()">
      <span class="crowd-desc-del"></span>
      <span class="crowd-del">删除</span>
    </div>
    <div class="crowd-desc-onn seed-flexbox seed-flexbox-align-center seed-flexbox-content-between"
         *ngIf="crowdDetail.crowdStatus == 6 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
         (click)="pushCrowd()">
      <span class="crowd-desc-on"></span>
      <span  class="crowd-del" >上架</span>
    </div>
    <button  class="crowd-entitle-table6"
             *ngIf="crowdDetail.crowdStatus == 6 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
             (click)="entitleTable()">权益列表</button>
    <button class="crowd-entitle-table7"
            *ngIf="crowdDetail.crowdStatus == 6 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
            (click)="editToDeal()">编辑</button>
    <!--审核未通过-->
    <button class="crowd-entitle-table2" *ngIf="crowdDetail.crowdStatus == 2 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
            (click)="entitleTable()">权益列表</button>
    <button class="crowd-write" *ngIf="crowdDetail.crowdStatus == 2 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
            (click)="editToDeal()">编辑</button>

    <!--众筹成功-->
    <div class="manage-activity-status seed-flexbox seed-flexbox-align-center seed-flexbox-content-between"
         *ngIf="crowdDetail.crowdStatus == 4 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
         (click)="manageToStatus()">
      <span class="manage-status"></span>
      <span class="manage-activity">管理活动状态</span>
    </div>
    <div class="again-push  seed-flexbox seed-flexbox-align-center seed-flexbox-content-between"
         *ngIf="crowdDetail.crowdStatus == 4 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
         (click)="launchAgain()">
      <span class="again-push-again"></span>
      <span class="again-start">再次发起</span>
    </div>
    <button  class="crowd-entitle-table4"  *ngIf="crowdDetail.crowdStatus == 4 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
             (click)="entitleTable()"
    >权益列表</button>
    <!--众筹失败-->
    <div class="again-push-crowd  seed-flexbox seed-flexbox-align-center seed-flexbox-content-between"
         *ngIf="crowdDetail.crowdStatus == 5 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
         (click)="launchAgain()">
      <span class="again-push-again"></span>
      <span class="again-start">再次发起</span>
    </div>
    <button  class="crowd-entitle-table5" *ngIf="crowdDetail.crowdStatus == 5 && hasLogin && (userId==crowdDetail.userBaseResp.userId)"
             (click)="entitleTable()"
    >权益列表</button>
  </div>
</seed-content>


